package com.ido.switchmodel.bean;

import com.google.gson.Gson;

import java.util.HashMap;

public class DataBean {
    /**
     * "adType":"LAUNCH_AD",
     * "adCustomData":"",
     * "adIsOpen":true,
     * "adVid":"37ff21e0b1ae11e98fc77cd30abeb94e",
     * "adSupportType":"THREE_PARTY_SEQUENCE",
     * "adExtendData":"{\"sequence\":[\"TOUTIAO\",\"GDT\"],\"self\":{\"mtPackageName\":null,\"mtVersionCode\":100,\"mtType\":\"OPEN\",\"mtUrl\":\"https://oss.idourl.com/upload/20210120/cc1b77b48b144657be3d8d4b3e8e9d59.apk\",\"mtImage\":\"https://oss.idourl.com/upload/20210120/3e27fb3b97f447d688f7ad546060648f.jpg\"}}"
     */

    private String adExtendData;
    private String adCustomData;
    private boolean adIsOpen;
    private String adSupportType;
    private String adType;
    private String adVid;

    public String getAdVid() {
        return adVid;
    }

    public void setAdVid(String adVid) {
        this.adVid = adVid;
    }


    public HashMap<String, Object> getExtendDataMap() {
        try {
            Gson gson = new Gson();
            HashMap<String, Object> sequenceDataMap = gson.fromJson(this.adExtendData, HashMap.class);
            return sequenceDataMap;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }


    public boolean isAdIsOpen() {
        return adIsOpen;
    }


    public String getAdSupportType() {
        return adSupportType;
    }

    public String getAdExtendData() {
        return adExtendData;
    }

    public HashMap<String, Object> getCustomDataMap() {
        try {
            Gson gson = new Gson();
            HashMap<String, Object> customDataMap = gson.fromJson(this.adCustomData, HashMap.class);
            return customDataMap;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    public String getAdCustomData() {
        return adCustomData;
    }


    public String getAdType() {
        return adType;
    }


}
